package cn.kelvin.one;

import org.junit.Assert;
import org.junit.Test;

public class Test01 {
	public static void main(String[] args) {
		
	}
	
	@Test
	public void test1(){
		byte a = 1;
//		Assert.assertTrue(a << 7>0);
//		Assert.assertTrue(a << 8<0);
//		Assert.assertEquals(a << 8,Byte.MIN_VALUE);
		System.out.println(a<<7);
		System.out.println(a<<8);
		System.out.println(Byte.MIN_VALUE);
	}
	
	@Test
	public void test02(){
		short a = Byte.MIN_VALUE;
		int b = Short.MIN_VALUE;
		short c = Byte.MAX_VALUE + 1;
		byte d = (byte)(Byte.MAX_VALUE + 1);
		System.out.println(Byte.MIN_VALUE);
		System.out.println(Short.MIN_VALUE);
		System.out.println(Byte.MAX_VALUE);
		System.out.println(Byte.MAX_VALUE + 1);
		System.out.println(d);
	}
	
	@Test
	public void test03(){
		String a = "hello,";
		final String b = "world";
		String c = "hello," + b;
		String d = a+b;
		String e = "hello,world";
		System.out.println(e==c);
		System.out.println(d==e);
		System.out.println(e.equals(d));
	}
	
	@Test
	public void test04(){
		System.out.println(((Long)1000L) == 1000);
        System.out.println(((Long)1000L) == Long.valueOf(1000));
        System.out.println(new Long(1).equals(1L));
        
        System.out.println(new Long(1).equals(1));
        
        System.out.println(new MyLong(1).equals(Short.valueOf((short)1)));
	}
}
